package com.unitd.modules.comm.model;

import com.unitd.frame.comm.bean.BaseBean;

/**
 * @desc 自定义的用于html页面的下拉菜单的动态显示的下拉菜单属性定义类
 * @filename SelectOption.java
 * @copyright www.unitd.com
 * @author Hudan
 * @version 1.0
 * @date 2016/10/4
 */
public class SelectOption extends BaseBean {

	/** 下拉菜单实际值 */
	private String value;
	/** 下拉菜单显示值 */
	private String text;
	/** 是否被选中 */
	private boolean selected;

	public SelectOption(String value, String text) {
		this.value = value;
		this.text = text;
	}

	public SelectOption(String value, String text, boolean selected) {
		this.value = value;
		this.text = text;
		this.selected = selected;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public boolean isSelected() {
		return selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((value == null) ? 0 : value.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SelectOption other = (SelectOption) obj;
		if (value == null) {
			if (other.value != null)
				return false;
		} else if (!value.equals(other.value))
			return false;
		return true;
	}
}